﻿using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Himp.Erp.Migrations
{
    /// <inheritdoc />
    public partial class add_table_InvChgType : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "OrderCnt",
                schema: "Erp",
                table: "MatlInv");

            migrationBuilder.RenameColumn(
                name: "BatchNo",
                schema: "Erp",
                table: "MatlInv",
                newName: "Bchno");

            migrationBuilder.AlterColumn<decimal>(
                name: "TotalCnt",
                schema: "Erp",
                table: "MatlInv",
                type: "numeric",
                nullable: false,
                oldClrType: typeof(decimal),
                oldType: "numeric(18,2)");

            migrationBuilder.AlterColumn<decimal>(
                name: "FinlCnt",
                schema: "Erp",
                table: "MatlInv",
                type: "numeric",
                nullable: false,
                oldClrType: typeof(decimal),
                oldType: "numeric(18,2)");

            migrationBuilder.AddColumn<decimal>(
                name: "ChgCnt",
                schema: "Erp",
                table: "MatlInv",
                type: "numeric",
                nullable: false,
                defaultValue: 0m);
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "ChgCnt",
                schema: "Erp",
                table: "MatlInv");

            migrationBuilder.RenameColumn(
                name: "Bchno",
                schema: "Erp",
                table: "MatlInv",
                newName: "BatchNo");

            migrationBuilder.AlterColumn<decimal>(
                name: "TotalCnt",
                schema: "Erp",
                table: "MatlInv",
                type: "numeric(18,2)",
                nullable: false,
                oldClrType: typeof(decimal),
                oldType: "numeric");

            migrationBuilder.AlterColumn<decimal>(
                name: "FinlCnt",
                schema: "Erp",
                table: "MatlInv",
                type: "numeric(18,2)",
                nullable: false,
                oldClrType: typeof(decimal),
                oldType: "numeric");

            migrationBuilder.AddColumn<decimal>(
                name: "OrderCnt",
                schema: "Erp",
                table: "MatlInv",
                type: "numeric(18,2)",
                nullable: false,
                defaultValue: 0m);
        }
    }
}
